PATHMac OS 8 Developer Documentation > Operating System Services > Multiprocessing Services >

Adding Multitasking Capability to Applications Using Multiprocessing Services

   

MPSetTaskWeight

Assigns a relative weight to a task, indicating how much processor time it should receive compared to other available tasks.

OSStatus MPSetTaskWeight (
                     MPTaskID task,
                     MPTaskWeight weight);
task
A value of type MPTaskID that specifies the ID of the task to which you want to assign a weighting.
weight
A value of type MPTaskWeight indicating the relative weight to assign. This value can range from 1 to 10,000, with the default value being 100.
function result
A result code. See Result Codes for a list of possible values.
DISCUSSION

The approximate processor share is defined as

weight of the task/ total weight of available tasks

For a set of ready tasks, the amount of CPU time dedicated to the tasks will be determined by the dynamically computed share. Note that the processor share devoted to tasks may deviate from the suggested weighting if critical tasks require attention. For example, a real-time task (such as a QuickTime movie) may require more than its relative weight of processor time, and the scheduler will adjust proportions accordingly.

VERSION NOTES

Introduced with Multiprocessing Services 2.0.


© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)